<template>
	<view class="page">
		<!-- 导航区域 -->
		<u-navbar title="用户管理" :autoBack="true" leftText="返回" bgColor="rgba(255,255,255,0)"></u-navbar>

		<view class="main" :style="activeType == 'orderData' ? 'overflow:hidden' : 'overflow:auto'">
			<view class="title-button">
				<text @click="changetype('orderData')"
					:class="activeType == 'orderData' ? 'active' : 'button-item'">订单数据</text>
				<text @click="changetype('fenxiaoData')"
					:class="activeType == 'fenxiaoData' ? 'active' : 'button-item'">分销数据</text>
			</view>

			<!-- 组件 -->
			<orderData v-if="activeType == 'orderData'"></orderData>
			<fenxiaoData v-if="activeType == 'fenxiaoData'">
			</fenxiaoData>
			<!-- <component :is="activeType"></component> -->
		</view>
	</view>
</template>

<script>
	import orderData from '@/components/my/order_data.vue';
	import fenxiaoData from '@/components/my/fenxiao_data.vue';
	export default {
		components: {
			orderData,
			fenxiaoData
		},
		data() {
			return {
				activeType: 'orderData'
			};
		},
		onLoad(e) {
			console.log(e);
			this.activeType = e.type;
		},
		methods: {
			changetype(type) {
				this.activeType = type;
			}
		}
	}
</script>

<style lang="scss">
	.page {
		.main {
			width: 750rpx;
			height: 1370rpx;
			background: #ffffff;
			border-radius: 64rpx 64rpx 0rpx 0rpx;
			// border: 1px solid;
			position: fixed;
			top: 34rpx;
			overflow: auto;

			.title-button {
				display: flex;
				align-items: center;
				margin: 66rpx auto 0;
				width: 100%;
				height: 80rpx;

				text {
					width: 50%;
					display: block;
					text-align: center;
					color: #696969;
				}

				.active {
					transition: 0.3s;
					color: #541A5F;
					border-bottom: 6rpx solid #CFAE7D;
					height: 100%;
					display: flex;
					justify-content: center;
					align-items: center;
					font-weight: 700;
					border-radius: 6rpx;
				}
			}
		}
	}
</style>